<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>3.ajax_get.html</title>


</head>
<body>
<div id="content">
</div>
<button id="btn">7.ajax_req_error.html</button>

<script>
    let btn = document.getElementById("btn");
    let content = document.getElementById("content");
    btn.onclick=()=>{
        const  xhr = new XMLHttpRequest();
        xhr.onreadystatechange =()=>{
            if (xhr.status === 4){
            }
        };
        xhr.open("get","./ajax_get");
        xhr.send();
        xhr.timeout =2000;
        xhr.ontimeout =()=>{
            
        }
        xhr.onerror =()=>{
          
        }


    }



</script>
</body>
</html>